{include file=header.html}
        <link href="{lib file=jquery.ui.1.10.2/css/ui-lightness/jquery-ui-1.10.2.custom.css}" rel="stylesheet">
       <script type="text/javascript" language="javascript" src="{lib file=jquery-1.6.3.min.js}"></script>
       <script language="javascript" type="text/javascript" src="{lib file=jquery.ui.1.10.2/js/jquery-ui-1.10.2.custom.js}"></script>

      <script language="javascript" type="text/javascript" src="{res file=js/fabric_info.js}"></script>
        <script language="javascript" type="text/javascript" src="{lib file=jquery.plugins/jquery.validate.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=DatePicker/WdatePicker.js}"></script>
        <script language="javascript" type="text/javascript" src="{lib file=ajaxfileupload.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/jquery.funkyUI.js}"></script>
        <script language="JavaScript" type="text/javascript" src="{res file=js/lan.js}"></script>
        <link href="template/style/css/style.css" type="text/css" rel="stylesheet" />
        <script language="javascript" type="text/javascript" src="{res file=js/select.js}"></script>
        <script language="javascript" type="text/javascript" src="{res file=js/auto_textarea.js}"></script>
        <style>
            label.error {color:red;}
			.center {text-align:center;}
			tr.fabric_info_list td input{width:100%;height:100%;}
			.btn-2{margin-bottom:5px;}
			input{margin-right:5px;}
            .input-1 {line-height:18px;width:158px;}
			 .select-1 {line-height:18px;width:160px;}

        </style>
    </head>
<body>
<script type="text/javascript">
$(function() {
	$('#factory_id').change(function() {
		if($(this).val()!=0){
			$('#factory_name').val($(this).children(':selected').html());
		}
	});
	if ($('#factory_name').val() == '') {
		$('#factory_id').change();
	}
	$('select[select_input="select_input"]').each(function(i) {
		init_select_input($(this));
	});
	$('div.select-input').each(function(i) {
		$(this).css('z-index', $('div.select-input').length - i);
	});
	$('#add_fabric_info').click(function() {
		var tr = $('<tr><td colspan="3"></td><td colspan="3"></td><td></td></tr>');
		var sel_input = $($('#fabric_shop_data').html());
		sel_input.attr('select_input', 'select_input');
		sel_input.attr('name', 'new_fabric_info[][fabric_shop_id]');
		sel_input.attr('id', 'new_fabric_info[][fabric_shop_id]');
		sel_input.attr('class', 'input-3');
		var desc = $('<input type="text" class="input-3" name="new_fabric_info[][description]">');
		tr.find('td:eq(0)').append(desc);
		tr.find('td:eq(1)').append(init_select_input(sel_input));
		$('div.select-input').each(function(i) {
			$(this).css('z-index', $('div.select-input').length - i);
		});
		tr.css('background-color', '#F4F8FA');
		var add_fabric_shop = $('#add_fabric_shop');
		tr.insertAfter(add_fabric_shop.parents('tr'));
		if ($('input.btn-2[value="移除"]').length < 1) {
			add_fabric_shop.parent().append($('<input type="button" value="移除" class="btn-2" />'));
		}
		tr.find('td:eq(2)').append($('<input type="button" value="移除" class="btn-2" />'));
		tr.find('td:eq(2)').append(add_fabric_shop);
		sort_new_fabric_info();
	});

	$('#add_fabric_shop').click(function() {
		var value = $.trim(prompt("请输入布行/档口名称：", ''));
		if (value != '' && confirm('系统将增加此布行信息到系统，请确认是否重复。\r\n' + value + '\r\n确定要添加该布行吗？')) {
			$.post('index.php?app=fabric_shop&act=AjaxAdd', {'fabric_shop_name' : value}, function(json) {
				if (json.done) {
					ref_fabric_shop();
				}
				alert(json.msg);
			}, 'json');
		}
	});
	$('input[acttype="confirm"]').click(function() {
		if (confirm('是否已经保存信息？更新样板信息之后将会使已确认样板状态无效。\r\n\r\n是否继续？')) {
			$.getJSON('index.php?app=sample&act=confirm&id={$smarty.get.id}', function(json) {
				alert(json.msg);
			});
		}
	});
	<!--{if $order.confirm_date || $order.status == 5}-->
	$('[name^="new_fabric_info"]').attr('disabled', true);
	$('[name^="old_fabric_info"]').attr('disabled', true);
	$('input.input-3').attr('disabled', true);
	<!--{/if}-->
	

});

function sort_new_fabric_info()
{
	$('input[name^="new_fabric_info"][name$="[description]"]').each(function(i) {
		$(this).attr('name', 'new_fabric_info[' + i + '][description]');
	});
	$('input[name^="new_fabric_info"][name$="[fabric_shop_id]"]').each(function(i) {
		$(this).attr('name', 'new_fabric_info[' + i + '][fabric_shop_id]');
		$(this).attr('id', 'new_fabric_info[' + i + '][fabric_shop_id]');
	});
}

function remove_fabric_shop(_this)
{
	if (!confirm('确定要移除该面料信息吗？')) {
		return false;
	}
	$(_this).parent().parent().remove();
}

function get_sample(obj){
	var id=obj.value;
	if(!id) return;
	$.getJSON('index.php?app=order&act=getsample&ajax=1&id='+id,function(json){
		if(json.done){
			$('#arrival_date').attr('value',json.retval.arrival_date);
			if(json.retval.front_pic!=''){
				$('#front_pic').attr('value',json.retval.front_pic);
				$('#front_image').attr('src',json.retval.front_pic);
				$('#front_image').show();
			}
			if(json.retval.other_pic!=''){
				$('#back_image').attr('src',json.retval.other_pic);
				$('#back_pic').attr('value',json.retval.other_pic);
				$('#back_image').show();
			}
			$('#style_id').attr('value',json.retval.style_id);
			$('#special_id').attr('value',json.retval.special_id);
			$('#factory_id').attr('value',json.retval.factory_id);
			$('#fabric_id').attr('value',json.retval.fabric_id);
			$('#feature_id').attr('value',json.retval.feature_id);
			if("{$user.role}"!="{$u_client}"){
				$('#factory_files').html('');
				var files = json.retval.factory_files;
				for (var key in files) {
					$('#factory_files').html($('#factory_files').html() + ($('#factory_files').html() == '' ? '' : '<br />'));
					$('#factory_files').html($('#factory_files').html() + '<a href="download.php?id=' + files[key].file_id + '">' + files[key].file_name + '</a><a class="pic_del" href="{url app=comupload&act=delete&id=}' + files[key].file_id + '" onClick="return confirm(\'{$lang.confirm_del_file}\')" title="{$lang.delete}">&nbsp;</a>');
				}
			}
		}else{
			alert(json.msg);
		}
	});
}

function get_order_sn(obj){
	var style_sn=obj.value;
	if(!style_sn)
	{
		$(obj).next("select").hide();
		 return;
	}
	$.getJSON('index.php?app=order&act=get_order_list&ajax=1&style_sn='+style_sn,function(json){
		if(json.done){
			$(obj).next("select").empty();
			$(obj).next("select").append("<option></option>");
			 $(obj).next("select").show();
             $.each(json.retval,function(i,val){
            	 $(obj).next("select").append("<option value='" + val.order_id + "'>" + val.order_sn + "</option>");
             })
		}else{
			$(obj).next("select").empty();
			$(obj).next("select").append("<option></option>");
			alert(json.msg);
		}
	});
}

function get_order(obj){
	var order_id=obj.value;
	if(!order_id)
	{
		 return;
	}
	$.getJSON('index.php?app=order&act=getorder&ajax=1&order_id='+order_id,function(json){
		if(json.done){
			if(json.retval.front_pic!=''){
				$('#front_pic').attr('value',json.retval.front_pic);
				$('#front_image').attr('src',json.retval.front_pic);
				$('#front_image').show();
			}
			else
			{
				$('#front_pic').attr('value',"");
				$('#front_image').attr('src',"not_exist.jpg");
			}
			if(json.retval.back_pic!=''){
				$('#back_image').attr('src',json.retval.back_pic);
				$('#back_pic').attr('value',json.retval.back_pic);
				$('#back_image').show();
			}
			else
			{
				$('#back_image').attr('src',"not_exist.jpg");
				$('#back_pic').attr('value',"");
			}
			$('#brand_id').attr('value',json.retval.brand_id);
			//$('#brand_id option').remove();
			//$('#brand_id').append("<option value='"+json.retval.brand_id+"'>"+json.retval.brand_name+"</option>");
			$('#buyer_id option').remove();
			$('#buyer_id').append("<option value='"+json.retval.buyer_id+"'>"+json.retval.buyer_name+"</option>");
			$('#merchandiser_id option').remove();
			$('#merchandiser_id').append("<option value='"+json.retval.merchandiser_id+"'>"+json.retval.merchandiser+"</option>");
			$('#style_id').attr('value',json.retval.style_id);
			$('#factory_id').attr('value',json.retval.factory_id);
			$('#factory_price').val(json.retval.factory_price);
			$('#customer_price').val(json.retval.customer_price);
			$('#brand_addr').removeAttr('disabled');
			$('#brand_addr option').remove();
			$('#brand_addr').append("<option value='"+json.retval.brand_addr+"'>"+json.retval.brand_addr+"</option>");
			$('#order_sn').val(json.retval.order_sn);
			$('#style_sn').val(json.retval.style_sn);
			$('#quantity').val(json.retval.quantity);
			$('#release_date').val(json.retval.release_date);
			$('#buyer_arrival_date').val(json.retval.buyer_arrival_date);
			$("#clone_order_id").val(json.retval.order_id);
			
		}else{
			alert(json.msg);
		}
	});
}

function change_pic(id){
	$.funkyUI({url:"index.php?app=comupload&act=order_pics&id="+id,css:{width:"400",height:"250"}});
	return false;
}

function confirm_order(id) {
	if(!confirm('确认代表工厂已经同意此订单页面内的所有信息，是否确认？')) {
		return false;
	}
	$.getJSON('index.php?app=order&act=update_status&status=2&ajax=1&id=' + id, function(json) {
		if(json.done) {
			location.href = location.href;
		} else {
			alert(json.msg);
		}
	});
}
function cancel_order(id){
	if(!confirm('取消后不可修改，确认？')) {
		return false;
	}
	$.getJSON( 'index.php?app=order&act=update_status&status=5&ajax=1&id=' + id, function(json) {
		if(json.done) {
			location.href = location.href;
		} else {
			alert(json.msg);
		}
	});
}
function chuhuo(id)
{
	if (confirm('确认已出货？')) {
		$.getJSON('index.php?app=order&act=update_status&status=3&ajax=1&id=' + id, function(json) {
			if (json.done) {
				location.href = location.href;
			} else {
				alert(json.msg);
			}
		});
	}
}

function addbuff()
{

	var buff=encodeURI($("#add_buff").val());
	if(buff!="")
	{
		var url="{$site_url}/index.php?app=order&act=addrecord&id={$order.order_id}&buff="+buff;
		$.getJSON(url,function(ret){
				if(ret.done)
				{
					$("#add_buff").val("");
					if($("#record_list p").size()>0)
					{
					$("#record_list p:first").before(ret.retval);
					}
					else
					{
					$("#record_list").append(ret.retval);
					}
				}
				else
				{
					alert(ret.msg);
				}
			
			});	
	}
}

function approve_no()
{
	
	if($("#approve_no_desc").val()=="")
	{
		$.funkyUI({url:"index.php?app=order&act=approve_not_pass",css:{width:"455",height:"330"}});
		return false;
	}
	return true;
}

function check_create_order()
{

	var err_msg='';
	if($("#buyer_arrival_date").val()=="")
	{
		err_msg="请输入客人入仓期,客人入仓期不能为空";
	}
	if("{$user.role}"!="{$u_client}"){
		if($("#release_date").val()=="")
		{
			err_msg="请输入工厂入仓期,工厂入仓期不能为空";
		}
	}
	if($("#quantity").val()=="")
	{
		err_msg="请输入件数,件数不能为空";
	}
	if($("#style_sn").val()=="")
	{
		err_msg="请输入款号,款号不能为空";
	}
	if($("#order_sn").val()=="")
	{
		err_msg="请输入订单号,订单号不能为空";
	}
	if($("#merchandiser_id").val()=="0")
	{
		err_msg="请选择跟单,跟单不能为空";
	}	
	if($("#buyer_id").val()=="")
	{
		err_msg="请选择买手,买手不能为空";
	}	
	/* if($("#brand_id").val()=="0")
	{
		err_msg="请选择品牌,品牌不能为空";
	} */
	
	if(err_msg!='')
	{
		alert(err_msg);
		return false;
	}
	return true;
}

//翻单
function check_clone_order()
{
	if(!$("#clone_order_id").val())
	{
		alert("请选择翻单款号与翻单单号再执行翻单操作!");
		return false;
	}
	return true;
}

//检查工厂做货量
function check_goods_num(){
	var id=$("#factory_id").val();
	var mydate=new Date();
	var year=mydate.getFullYear();
	var month=mydate.getMonth()+1;
	$.ajax({
		url:'index.php?app=order&act=check_order_goods_num&factory_id='+id+'&year='+year+'&month='+month,
		type:'get',
		dataType:'json',
		error:function(){
			alert('网络连接错误，请稍后再试');
		},
		success:function(data){
			if(data.flag){
				alert(data.msg);
			}else{
				alert(data.msg);
			}
		}
	});
}
</script>
<div id="fabric_shop_data" style="display:none;"><select><!--{foreach from=$fabricshop_list item=fabric_shop}--><option value="{$fabric_shop.fabric_shop_id}">{$fabric_shop.fabric_shop_name|escape}</option><!--{/foreach}--></select></div>
<div class="sub-body">
	<h3 class="title-1 tab-frame"><span>订单信息</span></h3>
    <div class="tab-frame" style="width:900px;">
		<form method="post" name="order_add_form" id="order_add_form" onsubmit="return check_create_order()">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
            	<th  align="right" width="120">下单日期：</th>
            	<td width="180"><!--{if $order.order_create_date==0}-->{$now_date}<!--{else}-->{$order.order_create_date|date}<!--{/if}--><input type="hidden" class="input-1" name="info[order_create_date]" id="order_create_date"  readonly="readonly" value="<!--{if $order.order_create_date==0}-->{$now_date}<!--{else}-->{$order.order_create_date|date}<!--{/if}-->" /></td>
            	<th colspan="2" width="300">正面</th>
            	<th colspan="2" width="300">反面</th>
            </tr>
			<tr>
            	<th  align="right">品牌：</th>
            	<td><select name="info[brand_id]"  id="brand_id" onChange="brand_change(this.value);" class="select-1" >
					<!-- {if $user.role!=USER_CLIENT} -->
					<option value="0">{$lang.select_pls}</option>
					<!-- {/if} -->
					<!--{foreach from=$brand_list item=brand key=k}-->
					<option value="{$brand.brand_id}"{if $order.brand_id == $brand.brand_id} selected{/if}>{$brand.brand_name}&nbsp;&nbsp;({$brand.company_name|escape})</option>
					<!--{/foreach}-->
			  </select></td>
            	<td colspan="2" rowspan="11" align="center"><img id="front_image" width="220" height="264" src="{$order.front_pic}" alt=""></td>
            	<td colspan="2" rowspan="11" align="center"><img id="back_image" width="220" height="264" src="{$order.back_pic}" alt=""></td>
            </tr>

        	<tr>
            	<th  align="right">买手：</th>
            	<td>
                    <select name="info[buyer_id]"  id="buyer_id" class="select-1" onchange="buyer_change(this.value)">
					<!-- {if $user.role!=USER_CLIENT} -->
					<option value="0">{$lang.select_pls}</option>
					<!-- {/if} -->
					<!--{foreach from=$buyer_list item=buyer key=k}-->
					<option value="{$buyer.user_id}"{if $order.buyer_id == $buyer.user_id} selected{/if}>{$buyer.user_name}</option>
					<!--{/foreach}-->
			  </select>
              </td>
            </tr>
           
			<tr>
            	<th  align="right">跟单：</th>
            	<td><select name="info[merchandiser_id]"  id="merchandiser_id" class="select-1" >
					<!-- {if $user.role!=USER_CLIENT} -->
					<option value="0">{$lang.select_pls}</option>
					<!-- {/if} -->
					<!--{foreach from=$merchandiser_list item=merchandiser key=k}-->
					<option value="{$merchandiser.user_id}"{if $order.merchandiser_id == $merchandiser.user_id} selected{/if}>{$merchandiser.user_name}</option>
					<!--{/foreach}-->
			  </select></td>
            </tr>
        	<tr>
            	<th  align="right">订单号：</th>
            	<td><input type="text" class="input-1" name="info[order_sn]" id="order_sn" value="{$order.order_sn|escape}"    /></td>
            </tr>
        	<tr>
            	<th  align="right">款号：</th>
            	<td><input type="text" class="input-1" name="info[style_sn]" id="style_sn" value="{$order.style_sn}"    /></td>
            </tr>
        	<tr>
            	<th  align="right">参考板号：</th>
            	<td><select name="info[sample_id]" id="sample_id" class="select-1" onchange="get_sample(this)"    />
					<option value="0">{$lang.select_pls}</option>
					<!--{foreach from=$sample_list item=sample key=k}-->
					<option value="{$sample.sample_id}"{if $order.sample_id == $sample.sample_id} selected{/if}>{$sample.sample_sn}</option>
					<!--{/foreach}-->
				</select></td>
            </tr>
        	<tr>
            	<th  align="right">到板日期：</th>
            	<td><input type="text" class="input-1" name="info[arrival_date]" id="arrival_date"  value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"    /></td>
            </tr>
        	<tr>
            	<th  align="right">款式：</th>
            	<td><select name="info[style_id]" id="style_id" class="select-1"   >
					<option value="0">{$lang.select_pls}</option>
					<!--{foreach from=$style_list item=style key=k}-->
					<option value="{$style.style_id}"{if $order.style_id == $style.style_id} selected{/if} >{$style.style_name}</option>
					<!--{/foreach}-->
				</select></td>
            </tr>
        	<tr>
        		<!-- {if $user.role!=USER_CLIENT} -->
            	<th  align="right">工厂：</th>
            	<td><select name="info[factory_id]" id="factory_id" class="select-1" onchange="check_goods_num()" >
					<option value="0">{$lang.select_pls}</option>
					<!--{foreach from=$factory_list item=factory key=k}-->
					<option value="{$factory.factory_id}"{if $order.factory_id == $factory.factory_id} selected{/if}>{$factory.factory_name}</option>
					<!--{/foreach}-->
				</select><input type="hidden" name="info[factory_name]" id="factory_name" value="{$order.factory_name}" /></td>
				<!-- {/if} -->
            </tr>
        	<tr>
            	<th  align="right">运输：</th>
            	<td><select class="select-1" name="info[trans_type]" id="trans_type"  >
                            <option value="0">海运</option>
                            <option value="1"{if $order.trans_type == 1} selected{/if}>空运</option>
                        </select></td>
            </tr>
            <tr>
            	<th  align="right">目的地：</th>
            	<td>
            	    <select name="info[brand_addr]" id="brand_addr" class="select-1"  >
						<option value="0">{$lang.select_pls}</option>
						<!-- {if $user.role eq USER_CLIENT} -->
						<!--{foreach from=$brand_addr_name item=brand_addr key=k}-->
						<option value="{$brand_addr}"{if $order.brand_addr == $brand_addr} selected{/if}>{$brand_addr}</option>
						<!--{/foreach}-->
						<!-- {/if} -->
					</select>
			   </td>
            </tr>
			<tr>
            	<th  align="right">件数：</th>
            	<td><input type="text" class="input-1" name="info[quantity]" id="quantity" value="{$order.quantity}"   /></td>
            	<td colspan="4" style="text-align:center;"><input id="front_pic" type="hidden" name="info[front_pic]" value="{$order.front_pic}"><input id="back_pic" type="hidden" name="info[back_pic]" value="{$order.back_pic}"><input type="button"  onclick="change_pic('{$order.order_id}');" class="btn-3"   value="更新图片"></td>
            </tr>
            <!-- {if $user.role!=USER_CLIENT} -->
			<tr>
            	<th  align="right">工厂价格：</th>
            	<td><input type="text" size="16" name="info[factory_price]" id="factory_price" value="{$order.factory_price}"   />元</td>
				<th  align="right" width="100">工厂入仓日期：</th>
				<td width="100"><input type="text" class="input-1" name="info[release_date]" id="release_date" value="" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"  /></td>
				<td width="100">&nbsp;</td>
				<td width="150">&nbsp;</td>
			</tr>
			<!-- {/if} -->
           {if $user.is_factory neq 1}
			<tr>
            	<th  align="right">客人价格：</th>
            	<td>
            		<input type="text" size="10"  name="info[customer_price]" id="customer_price" value="{$order.customer_price}" />
                    <select name="info[customer_price_name]" id="customer_price_name" >
                    	<option {if $order.customer_price_name == '美元'} selected{/if} value="美元">美元</option>
						<option {if $order.customer_price_name == '人民币'} selected{/if} value="人民币">人民币</option>
					</select>
            	</td>
            	{if $user.is_factory neq 1}
            	<th  align="right">客人入仓日期：</th>
            	<td>
                
                <input  type="text" class="input-1" name="info[buyer_arrival_date]" id="buyer_arrival_date" value=""  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"  />
			</td>
            {else}
        	{/if}
        		<!-- {if $user.role!=USER_CLIENT} -->
            	<th  align="right" width="100">报&nbsp;价&nbsp;单：</th>
				<td id="factory_files"><!--{foreach from=$file_price item=file}--><a href="download.php?id={$file.file_id}">{$file.file_name}</a>{if $is_edit}<a class="pic_del" href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}" >&nbsp;</a> {/if}<!--{if !$smarty.foreach.last}--><br /><!--{/if}--><!--{/foreach}--></td>
				<!-- {else} -->
				<td>&nbsp;</td>
				<td>&nbsp;</td>
				<!-- {/if} -->
            	</tr>
              {else}
              <tr>
			  <td>&nbsp;</td>
              	<td>&nbsp;</td>
              	<td>&nbsp;</td>
              	<td>&nbsp;</td>
              	<td>&nbsp;</td>
              	</tr> 
        	{/if}
        	<!-- {if $user.role==USER_CLIENT || $user.role==USER_MERCHANDISER || $user.role==USER_MANAGER} -->
			<tr>
				<th rowspan="2" align="right">客户评语：</th>
				<td colspan="5"><textarea style="width:99%; height:50px;" id="customer_reviews" name="info[consumer_comment_text]" <!-- {if $user.role!=USER_CLIENT} -->readonly="readonly"<!-- {/if} -->>{$order.consumer_comment_text}</textarea>
				</td>
			</tr>
          <tr>
				<td colspan="5">
				<!-- {if $user.role==USER_CLIENT} -->
                 <input  type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$consumer_comment_order}, {$default_cust_id});" />
                <!-- {/if} -->
            
           <div id="file_consumer_comment">
                <!--{foreach from=$file_comment item=file}-->
				<span><a href="download.php?id={$file.file_id}" >{$file.file_name}</a>
				<!-- {if $user.role==USER_CLIENT} -->
                <a class="pic_del" href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
                <!-- {/if} -->
                </span>
				<!--{if !$smarty.foreach.last}--><!--{/if}--><!--{/foreach}-->
                </div>
</td>
			</tr>
<tr>
				<th rowspan="2" align="right">客户备注：</th>
				<td colspan="5"><textarea style="width:99%; height:50px;" id="consumer_remarks" name="info[consumer_remarks_text]" <!-- {if $user.role!=USER_CLIENT} -->readonly="readonly"<!-- {/if} -->>{$order.consumer_remarks_text}</textarea>
</td>
			</tr>
          <tr>
				<td colspan="5">
				<!-- {if $user.role==USER_CLIENT} -->
                 <input  type="button" class="btn-3" value="{$lang.upload_enclosure}" onClick="upload_docs({$consumer_remarks_order}, {$default_cust_id});" />
            	<!-- {/if} -->
           <div id="file_consumer_remarks">
                <!--{foreach from=$file_remarks item=file}-->
				<span><a href="download.php?id={$file.file_id}" >{$file.file_name}</a>
                <!-- {if $user.role==USER_CLIENT} -->
                <a class="pic_del" href="{url app=comupload&act=delete&id=$file.file_id}" onClick="return confirm('{$lang.confirm_del_file}')" title="{$lang.delete}">&nbsp;</a>
                <!-- {/if} -->
                </span>
				<!--{if !$smarty.foreach.last}--><!--{/if}--><!--{/foreach}-->
                </div>
</td>
			</tr>
			<!-- {/if} -->
			<tr>
            	<th  align="right">翻单款号：</th>
            	<td colspan="5">
	            	<select name="copy_order_style_sn" id="copy_order_style_sn" class="select-1" onchange="get_order_sn(this)">
						<option value="">{$lang.select_pls}</option>
						<!--{foreach from=$style_sn_list item=sn key=k}-->
						<option value="{$sn.style_sn}">{$sn.style_sn}</option>
						<!--{/foreach}-->
					</select>
					<select name="copy_order_sn" id="copy_order_sn" class="select-1" onchange="get_order(this)" style="display: none">
						<option value="">{$lang.select_pls}</option>
					</select>
				</td>
			</tr>
		</table>
		<div style="text-align: center;padding-bottom: 10px;padding-top: 5px">
			<span><input type="submit" value="<!--{if $order.order_id gt 0}-->更新{else}新单{/if}" id="submit" class="btn-2" /></span>
			<span><input type="button" class="btn-2" value="返回" onclick="history.back();" /></span>
			<span><input type="submit" name="submit" class="btn-2" value="翻单" onclick="return check_clone_order()" /><br /></span>
            <span><input type="hidden" name="clone_order_id" id="clone_order_id" value="" /></span>	
            <div id="approve_not_pass_dialog" style="display:none;">
				<h2>审批不通过理由</h2>
               	<textarea style="width:300px; height:200px;"></textarea>
               	<input type="submit" name="submit"  class="btn-2" value="审批不通过"  />
			</div>
		</div>
		</form>
	</div>
</div>
<script language="JavaScript" type="text/javascript" src="{res file=js/tab_color.js}"></script>
<script type="text/javascript">
//客户评语
var customer_reviews = document.getElementById("customer_reviews");
autoTextarea(customer_reviews);// 调用 

//客户备注
var consumer_remark = document.getElementById("consumer_remarks");
autoTextarea(consumer_remark);// 调用 
</script>
</body>
{$async_sendmail}
</html>